import { defineConfig } from 'vite';
import { resolve } from 'path'
import uni from '@dcloudio/vite-plugin-uni';
// import legacy from '@vitejs/plugin-legacy'

export default defineConfig({
	plugins: [uni()],
  resolve: {
    alias: {
      '/@': resolve(__dirname, '.', './src/'),
    }
  },
  server: {
    "hot": true,
    "port": "8099",
    "open": false,
    "disableHostCheck": false,
    "proxy": {
      '/apiRequest': {
        target: 'http://116.62.172.200:9999',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apiRequest/, ''),
      },
    }
  },
  build: {
    target: ['chrome52'],
    cssTarget: ['chrome52']
  }
});
